package io.dshubs.archives.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.dshubs.commons.mybatis.entity.BaseEntity;
import io.dshubs.commons.mybatis.entity.BaseTenantEntity;
import io.dshubs.commons.tools.utils.DateUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * <p>
 * 档案鉴定表
 * </p>
 *
 * @author tan
 * @since 2021-08-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("archive_my_favorite")
public class ArchiveMyFavorite extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 全宗id
     */
    @TableField("archive_id")
    private Long archiveId;

    /**
     * 全宗号
     */
    @TableField(exist = false)
    private String archiveCode;

    /**
     * 全宗id
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 档号
     */
    @TableField("file_number")
    private String fileNumber;

    /**
     * 文件分类id
     */
    @TableField("category_id")
    private Long categoryId;

    /**
     * 题名
     */
    @TableField("title")
    private String title;

    /**
     * 更新者
     */
    @TableField("updater")
    private Long updater;

    /**
     * 更新时间
     */
    @TableField("update_date")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    @JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
    private Date updateDate;

    @TableField(exist = false)
    private String categoryName;

    @TableField(exist = false)
    private Date startDate;

    @TableField(exist = false)
    private Date endDate;
}
